package com.ruoyi.shop.idleComm.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.idleComm.mapper.IdleCommentMapper;
import com.ruoyi.shop.idleComm.domain.IdleComment;
import com.ruoyi.shop.idleComm.service.IIdleCommentService;

/**
 * 闲置评论Service业务层处理
 * 
 * @author yjy
 * @date 2025-06-10
 */
@Service
public class IdleCommentServiceImpl implements IIdleCommentService 
{
    @Autowired
    private IdleCommentMapper idleCommentMapper;

    /**
     * 查询闲置评论
     * 
     * @param commentId 闲置评论主键
     * @return 闲置评论
     */
    @Override
    public IdleComment selectIdleCommentByCommentId(Long commentId)
    {
        return idleCommentMapper.selectIdleCommentByCommentId(commentId);
    }

    /**
     * 查询闲置评论列表
     * 
     * @param idleComment 闲置评论
     * @return 闲置评论
     */
    @Override
    public List<IdleComment> selectIdleCommentList(IdleComment idleComment)
    {
        return idleCommentMapper.selectIdleCommentList(idleComment);
    }

    /**
     * 新增闲置评论
     * 
     * @param idleComment 闲置评论
     * @return 结果
     */
    @Override
    public int insertIdleComment(IdleComment idleComment)
    {
        idleComment.setPublishTime(DateUtils.getNowDate());
        return idleCommentMapper.insertIdleComment(idleComment);
    }

    /**
     * 修改闲置评论
     * 
     * @param idleComment 闲置评论
     * @return 结果
     */
    @Override
    public int updateIdleComment(IdleComment idleComment)
    {

        return idleCommentMapper.updateIdleComment(idleComment);
    }

    /**
     * 批量删除闲置评论
     * 
     * @param commentIds 需要删除的闲置评论主键
     * @return 结果
     */
    @Override
    public int deleteIdleCommentByCommentIds(Long[] commentIds)
    {
        return idleCommentMapper.deleteIdleCommentByCommentIds(commentIds);
    }

    /**
     * 删除闲置评论信息
     * 
     * @param commentId 闲置评论主键
     * @return 结果
     */
    @Override
    public int deleteIdleCommentByCommentId(Long commentId)
    {
        return idleCommentMapper.deleteIdleCommentByCommentId(commentId);
    }
}
